<?php

namespace App\Controller\Api;

use App\Controller\AbstractController;
use Hyperf\HttpServer\Request;
use Xxh\FileStore\Service\FileStoreAbstract;
use Hyperf\Di\Annotation\Inject;
use App\Service\Chat\ChatInterface;
use App\Service\File\FileInterface;
use App\Service\Wechat\WxFactoryService;
use Hyperf\HttpServer\Contract\RequestInterface;
use Hyperf\HttpServer\Contract\ResponseInterface;

use Hyperf\HttpServer\Annotation\AutoController;




/**
 * 轮播图
 * @AutoController()
 */
class TestController extends AbstractController
{



    /**
     * 文件管理
     * @Inject
     * @var FileStoreAbstract
     */
    private $file;


    public function filestore(RequestInterface $request, ResponseInterface $response)
    {

        $path = $this->file->store(
            $request->file('img')
        );
        
        return $this->file->url($path);    
    }



    public function put()
    {
        $path = $this->file->put('1.txt','Hello World');
        return $this->file->url($path);

    }




}